home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 May
/
EnigmA AMIGA RUN 18 (1997)(G.R. Edizioni)(IT)[!][issue 1997-05][EAR-CD II].iso
/
earcd
/
util
/
dir
/
managers.lha
/
Managers
/
Dir
/
Dir.view
< prev
next >
Wrap
Text File
|
1997-01-16
|
4KB
|
163 lines
G4C
; This file contains a routine, to read the file selected according
; to it's type. You can add type checks here, to your heart's content.
; The following variable has to be set beforehand
; FILENAME <- Must contain the file to be viewed
; You MUST set this before calling the routine.
; Do NOT use it afterwards as it will be deleted.
xRoutine ViewFile
if $FILENAME < " " ; no variable..
return
endif
extract FILENAME file rtn.temp ; see if it's a module
cutvar rtn.temp copy char 4 rtn.mod
delvar rtn.temp
if $rtn.mod == mod.
run '$DEF.MOD $FILENAME'
delvar rtn.mod
return
endif
docase $FILENAME
case H= "ã" ; icon probably
copy $FILENAME ram:t ; load gui which will show an icon
ifexists file ram:t/GCXX.info ; named ram:t/GCXX.info
delete ram:t/GCXX.info
endif
extract FILENAME FILE rtn_info2
joinfile ram:t $rtn_info2 rtn_info
rename $rtn_info ram:t/GCXX.info
guiload :dir.icon
guiopen dir.icon
guiscreen dir.icon front
return
break
case H= "FORM????ILBM" ; ILBM
cli '$rtn.option $DEF.ILBM >nil: $FILENAME'
return
break
case H= "FORM????ANIM" ; Animation
cli '$rtn.option $DEF.ANIM >nil: $FILENAME'
return
break
case H= "GIF" ; GIF
cli '$rtn.option $DEF.GIF >nil: $FILENAME'
return
break
case H= "??????JFIF" ; JPEG
cli '$rtn.option $DEF.JPG >nil: $FILENAME'
return
break
case H= "FORM????8SVX" ; 8svx Sound sample
cli '$rtn.option $DEF.8SVX >nil: $FILENAME'
return
break
case H= "PP" ; PowerPacked file
run '$rtn.option $DEF.PP >nil: $FILENAME'
return
break
case H= G4C ; Yes.. you guessed it.
GuiLoad $FILENAME
return
break
case H= ??-lh ; LhA
cli 'Lha x $FILENAME ram:'
return
break
case H= "ZOO ?.??" ; zoo
cli 'Zoo <* x// $FILENAME'
return
break
case H= ^Z ; pkax
cli 'pkax -x $FILENAME'
return
break
case H= PK ; unzip
cli 'unzip $FILENAME -d ram:'
return
break
case H= "@" ; Amigaguide (probably)
cli '$rtn.option $DEF.GUIDE $FILENAME'
return
break
case H= "%%%ó%" ; A program ? - Use dir.cli to run it.
setvar cl_Main '$FILENAME '
GuiLoad :dir/dir.cli
GuiOpen dir.cli
GuiScreen dir.cli front
update dir.cli 10 2 ; set it to RUN
setgad dir.cli 1 ON
return
break
case H= "????####" ; a text file (probably)
GuiLoad :dir.read ; damn thing doesn't recognise \n
guiopen dir.read ; as a printable character...
GuiWindow dir.read FRONT ; will change it for next version
GuiScreen dir.read FRONT ; of g4c
return
break
endcase
; If we got this far, let user decide what to do
guiopen dir.gv
; ######################################################################
NEWFILE dir.gv ; gui to decide what to do with unresolved files
WinBig 0 0 80 75 ""
WinType 01001000
winonmouse 40 10
xOnRMB
guiclose dir.gv
xOnInactive
guiclose dir.gv
xOnFail
ezreq "Error during operation" OK ""
;---------------> the Buttons
xbutton 0 0 0 15 MView
guiclose dir.gv
run '$DEF.MULTIVIEW $FILENAME'
xbutton 0 15 0 15 List
GuiLoad :dir.read ; damn thing doesn't recognise \n
guiopen dir.read ; as a printable character...
GuiWindow dir.read FRONT ; will change it for next version
GuiScreen dir.read FRONT ; of g4c
return
break
xbutton 0 30 0 15 Run
guiclose dir.gv
run '$FILENAME'
xbutton 0 45 0 15 With..
guiclose dir.gv
lv.run = ''
ReqFile -1 -1 300 220 'Run file with..' LOAD lv.run c:
if $lv.run > ''
run '$lv.run $FILENAME'
endif
delvar lv.run
xbutton 0 60 0 15 'CliGui'
guiclose dir.gv
setvar cl_Main '$FILENAME '
GuiLoad :dir/dir.cli
GuiOpen dir.cli
GuiScreen dir.cli front
update dir.cli 10 1 ; set it to CLI
setgad dir.cli 1 ON